//
//  FirstViewController.m
//  WangLottery
//
//  Created by leven hu on 12-4-22.
//  Copyright 2012年 __MyCompanyName__. All rights reserved.
//

#import "FirstViewController.h"


@implementation FirstViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
     [self initViewControl];

    
    
    UIBarButtonItem *helpBtn =[[UIBarButtonItem alloc] initWithTitle:@"帮助" style:UIBarButtonItemStylePlain target:self action:@selector(help)];   
    self.navigationItem.rightBarButtonItem = helpBtn; 
    [helpBtn release];
    
    /*UIBarButtonItem *favBtn=[[UIBarButtonItem alloc] initWithTitle:@"收藏夹" style:UIBarButtonItemStylePlain target:self action:@selector(Favorites)];
    self.navigationItem.rightBarButtonItem=favBtn;
    
   [favBtn release];*/
    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil; 
   
}

- (void)initViewControl{
   
    
      
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    FirstView *first=[[FirstView alloc]init];
    first.frame=CGRectMake(0,90, 320, selectLottery.frame.size.height);
    [first drawView];
    [selectLottery addSubview:first];
    [first release];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

#pragma User Action

//弹出帮助界面
- (void)help{

}


//弹出收藏界面
- (void)Favorites{

}

- (IBAction)tryTheirLuck{
    
    Latestlottery *viewController = [[Latestlottery alloc] initWithNibName:@"Latestlottery" bundle:nil];
    
    viewController.hidesBottomBarWhenPushed=YES;
    
    [self.navigationController pushViewController:viewController animated:YES];

}

@end
